<template>
    <div></div>
</template>

<script>
    import CryptoJS from 'crypto-js/crypto-js'
    export default {
        name: 'upload',
        data: function(){
            return {
                defaultSrc: '.@/@/static/img/img.jpg',
                fileList: [],
                imgSrc: '',
                cropImg: '',
                dialogVisible: false,
            }
        },
        methods:{
           
        },
        created(){
            var data = "888888";
            var srcs  = CryptoJS.enc.Utf8.parse(data);
            var key  = CryptoJS.enc.Utf8.parse('o7H8uIM2O5qv65l2');
            var string=Encrypt(data)
            console.log(string)
            console.log(Decrypt(string))

            function Encrypt(word){  
                var srcs = CryptoJS.enc.Utf8.parse(word);  
                var encrypted = CryptoJS.AES.encrypt(srcs, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7});  
                return encrypted.toString();  
            }  
            function Decrypt(word){  

                var decrypt = CryptoJS.AES.decrypt(word, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7});  
                return CryptoJS.enc.Utf8.stringify(decrypt).toString();  
            }
        }
    }
</script>

<style scoped>
    .content-title{
        font-weight: 400;
        line-height: 50px;
        margin: 10px 0;
        font-size: 22px;
        color: #1f2f3d;
    }
    .pre-img{   
        width: 100px;
        height: 100px;
        background: #f8f8f8;
        border: 1px solid #eee;
        border-radius: 5px;
    }
    .crop-demo{
        display: flex;
        align-items: flex-end;
    }
    .crop-demo-btn{
        position: relative;
        width: 100px;
        height: 40px;
        line-height: 40px;
        padding: 0 20px;
        margin-left: 30px;
        background-color: #409eff;
        color: #fff;
        font-size: 14px;
        border-radius: 4px;
        box-sizing: border-box;
    }
    .crop-input{
        position: absolute;
        width: 100px;
        height: 40px;
        left: 0;
        top: 0;
        opacity: 0;
        cursor: pointer;
    }
</style>